home *** CD-ROM | disk | FTP | other *** search
- Path: locutus.rchland.ibm.com!usenet
- From: Philip Staite <pstaite+@rchland.ibm.com>
- Newsgroups: comp.lang.c++
- Subject: Re: assignment operator and inheritance
- Date: Tue, 27 Feb 1996 08:12:05 -0600
- Organization: IBM Rochester, MN
- Message-ID: <31331135.446B@rchland.ibm.com>
- References: <candymanDn9C6L.Lq2@netcom.com>
- NNTP-Posting-Host: powertool.rchland.ibm.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; AIX 1)
-
- candyman@netcom.com wrote:
-
- > If I have base and child classes, where the child class is
- > derived from the base class. What is the syntax to use the
- > base class's assignment operator within the child class's
- > assignment operator definition?.
-
- derived_type& derived_type::operator=( const derived_type& d ) {
- base_type::operator=( d ); // assign base part
- // do other stuff here such as assign
- // instance data from derived_type
- return *this; }
-
-
- --
-
- Phil Staite, (507) 253-2529, team OS/2
- internet: pstaite@vnet.ibm.com internal: pstaite@rchland
-